home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / numberformat.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  697 b   |  30 lines

  1. <!--- This example shows the use of NumberFormat --->
  2. <HTML>
  3.  
  4. <HEAD>
  5. <TITLE>
  6. NumberFormat Example
  7. </TITLE>
  8. </HEAD>
  9.  
  10. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  11. <BODY  bgcolor="#FFFFD5">
  12.  
  13. <H3>NumberFormat Example</H3>
  14.  
  15. <CFLOOP FROM=1000 TO=1020 INDEX="counter">
  16. <CFSET CounterRoot2 = Evaluate(counter * sqr(2))>
  17.  
  18. <!--- Show the result in default format, adding the comma
  19. for the thousands place, and also in custom format,
  20. displaying to two decimal places --->
  21. <CFOUTPUT>
  22. <PRE>#counter# * Square Root of 2: #NumberFormat(CounterRoot2, '_____.__')#</PRE>
  23. <PRE>#counter# * Square Root of 2: #NumberFormat(CounterRoot2)#</PRE>
  24. </CFOUTPUT>
  25. </CFLOOP>
  26.  
  27. </BODY>
  28.  
  29. </HTML>       
  30.